<template>
	<view class="content">
		<u-navbar title="我的优惠券"  :placeholder="true" bgColor="rgba(0,0,0,0.0)" :autoBack="true">
		</u-navbar>
		<view class="ticket" v-for="(item,index) in pay_quanList" @click="gonavto" :key="index">
			<image class="ticket-bg" src="https://m.lqvvvv.com/assets/static/my/ticket-bg.png" mode=""></image> 
			<view class="ticket-box">
				<view class="ticket-price">
					￥<text>{{item.limit_money}}</text>
				</view>
				<view class="ticket-right">
					<view class="ticket-text">
						旅趣优惠券
					</view>
				</view>
			</view>
		</view>
		<u-loadmore :status="status"></u-loadmore>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pay_quanList:[],
				status:'loadmore',
				page:1
			}
		},
		onLoad() {
			this.postcoupon()
		},
		onReachBottom() {
			this.status = 'loading';
			this.page = this.page + 1
			this.postcoupon()
		},
		methods: {
			gonavto(){
				uni.switchTab({
					url:'/pages/business/index'
				})
			},
			postcoupon(){
				let params = {
					page:this.page
				}
				this.$Request({
					method: 'POST',
					url: '/api/user/getMyCoupon',
					data: params,
					ismsg: false,
				}).then(res => {
					if (res.code == 1) {
						if(res.data.data.length < 10)
						if(this.page == 1){
							this.pay_quanList = res.data.data
						}else{
							this.pay_quanList = [...this.pay_quanList,...res.data.data]
						}
					}
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.content {
		min-height: 100vh;
		background-image: url('https://m.lqvvvv.com/assets/static/index/nav-bg.png'); 
		background-repeat: no-repeat;
		background-size: 100% 800rpx;
		padding: 30rpx;
		.ticket {
			position: relative;
			.ticket-bg {
				width: 100%;
				height: 170rpx;
			}
			.ticket-box {
				width: 70%;
				padding: 35rpx 40rpx 40rpx 40rpx;
				position: absolute;
				top: 0;
				left: 0;
				display: flex;
				justify-content: space-between;
				align-items: center;
				color: #fff;
				.ticket-price {
					font-size: 38rpx;
					font-weight: 600;
					text {
						font-size: 70rpx;
						margin-left: 10rpx;
					}
				}
				.ticket-right {
					margin-left: 20rpx;
					.ticket-text {
						margin-top: 10rpx;
						font-size: 24rpx;
					}
				}
			}
		}
	}
</style>